const { request } = getApp();
Page({
  data: {
    detail: {},
    content: ''
  },
  fetchArtDetail(id){
    request('/cms/news/detail/v2', {
      data: {
        id
      }
    }).then(res => {
      if(res.data.code === 0) {
        this.setData({
          detail: res.data.data.info,
          content: res.data.data.info.content.replace(/<img/gi, '<img style="display:block;width: 100%"')
        })
        wx.setNavigationBarTitle({
          title: res.data.data.info.title
        })
      }

    })
  },
  onLoad(options) {
    this.fetchArtDetail(options.id);
  }
})